import pyttsx3
import os,time
import winsound

Bell_Audio_Path = os.path.dirname(__file__)+'/media/bell.wav'


# 语音播放
# engine = pyttsx3.init() #初始化语音引擎
# voices = engine.getProperty('voices')
# for voice in voices:
#     print(voice)
# engine.setProperty('voice',voices[0].id)
# engine.say('12345')
# engine.runAndWait()
# engine.stop()

def say(text: str):
    pyttsx3.speak(text)


def ring_bell(times: int):
    for i in range(times):
        winsound.PlaySound(Bell_Audio_Path, 1)
        time.sleep(1.5)

if __name__ == '__main__':
    ring_bell(2)
    # assert os.path.exists(Bell_Audio_Path)
    # winsound.PlaySound(Bell_Audio_Path,1)
    # time.sleep(2)
